PHP wordwrap() Function

您所在的位置:网站首页 php wordwrap PHP wordwrap() Function

PHP wordwrap() Function

#PHP wordwrap() Function| 来源: 网络整理| 查看: 265

PHP wordwrap() Function

❮ PHP String Reference

Example

Wrap a string into new lines when it reaches a specific length:

Try it Yourself » Definition and Usage

The wordwrap() function wraps a string into new lines when it reaches a specific length.

Note: This function may leave white spaces at the beginning of a line.

Syntax wordwrap(string,width,break,cut) Parameter Values Parameter Description string Required. Specifies the string to break up into lines width Optional. Specifies the maximum line width. Default is 75 break Optional. Specifies the characters to use as break. Default is "\n" cut Optional. Specifies whether words longer than the specified width should be wrapped: FALSE - Default. No-wrap TRUE - Wrap Technical Details Return Value: Returns the string broken into lines on success, or FALSE on failure. PHP Version: 4.0.2+ Changelog: The cut parameter was added in PHP 4.0.3 More Examples Example

Using all parameters:

Try it Yourself » Example

Wrap a string into new lines:

The HTML output of the code above will be (View Source):

An example of a long word is: Supercalifragulistic

The browser output of the code above will be:

An example of a long word is: Supercalifragulistic Try it Yourself » ❮ PHP String Reference


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3